#include<bits/stdc++.h>
using namespace std;
int main(){
    freopen("color.in","r",stdin);
	freopen("color.out","w",stdout);
    printf("18\n37\75337\n2790568\n565203\n440224\n50720490\n3766392328");
    return 0;
}

